<template>
  <view class="container">
    <input
      type="text"
      placeholder="请输入群名"
	  v-model="name"
	  maxlength="200"
      style="box-sizing: border-box; width: 690rpx; height: 96rpx; background: #f1edf0; border-radius: 16rpx 16rpx 16rpx 16rpx; padding: 24rpx 32rpx"
    />
    <view
      style="
        width: 690rpx;
        height: 80rpx;
        text-align: center;
        line-height: 80rpx;
        background: #feff01;
        border-radius: 20rpx 20rpx 20rpx 20rpx;
        font-weight: 500;
        font-size: 32rpx;
        color: #151515;
        margin: 120rpx 30rpx 0 0rpx;
      "
	  @click="edit"
    >
      确定
    </view>
  </view>
</template>

<script>
export default {
  data() {
    return {
		id:null,
		name:''
	};
  },
  onLoad(data) {
  	this.id = data.id
	this.name = data.qunname
  },
  methods:{
	  edit(){
		  if(this.name == '')return this.util.showToast('请输入群名称')
		  if(this.name.length > 12)return this.util.showToast('群昵称不超过12个字')
		  this.http('/group/updGroupRes',{
			  group_name:this.name,
			  id:this.id
		  }).then(res =>{
			  this.util.showToast(res.msg)
			  setTimeout(()=>{
				  uni.navigateBack()
			  },800)
		  })
	  }
  }
};
</script>

<style lang="scss">
.container {
  box-sizing: border-box;
  padding: 22rpx 30rpx;
}
</style>
